package com.zz.spring6.validator.three;


import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;

import javax.validation.Valid;
import javax.validation.constraints.NotNull;


@Service
@Validated // 基于方法进行校验
public class MyService {

    public String testMethod(@NotNull @Valid User user){
        return user.toString();
    }
}
